package com.sha.api.web.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

/**
 * https://github.com/lysmile/spring-boot-demo/blob/master/springboot-aop-demo/src/main/java/com/smile/demo/aop/ApiVisitHistory.java
 * */
@Component
@Aspect
public class ApiVisitCount {

    /**
     * 定义切面
     */
    @Pointcut("execution(* com.sha.api.web.controller.ApiController.*(..))")
    public void pointCut(){

    }

    @Before("pointCut()")
    public void doBefore(JoinPoint joinPoint){

    }

    @AfterReturning(returning = "returnVal", pointcut = "pointCut()")
    public void doAfterReturning(JoinPoint joinPoint, Object returnVal){

    }

    @AfterThrowing(pointcut = "pointCut()")
    public void doAfterThrowing(JoinPoint joinPoint){

    }
}
